//
//  RegionLocationAnnotation.m
//  location
//
//  Created by Dongxiang Xu on 2025/5/14.
//

#import "RegionLocationAnnotation.h"

@implementation RegionLocationAnnotation

- (instancetype)initWithAnnotation:(nullable id <MKAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier
{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        self.bounds = CGRectMake(0.f, 0.f, 52, 52);
        [self.layer setCornerRadius:26];
        [self.layer setBorderWidth:1];
        [self.layer setBorderColor:NormalMainColor.CGColor];
        self.backgroundColor = [NormalMainColor colorWithAlphaComponent:0.15];
                        
        _location = [[UIImageView alloc] initWithFrame:CGRectMake(0, -25, 52, 52)];
        _location.contentMode = UIViewContentModeScaleAspectFit;
        _location.image = [UIImage imageNamed:@"region_location"];
        [self addSubview:_location];
    }
    
    return self;
}

@end
